home *** CD-ROM | disk | FTP | other *** search
- /*
- * a recording routine
- * Copyright (C) 1995-1997 Kazutaka Hirata <khirata@jove.acs.unt.edu>
- */
-
- #include "stdafx.h"
-
- #include <stdio.h>
-
- #include "record.h"
-
- static int start = 0;
-
- RECORD_STREAM rec;
-
- #define RECORD_FNAME "record.txt"
-
- void record_mes(const char* mes)
- {
- FILE* fp = fopen(RECORD_FNAME, (start == 0) ? "w" : "a");
- if(fp == NULL) {
- fprintf(stderr, "\a\a\a");
- goto failed;
- }
- if(start == 0) {
- fprintf(fp, "Start\n");
- start = 1;
- }
- fprintf(fp, "%s", mes);
- fflush(fp);
- fclose(fp);
- failed:
- return;
- }
-